package calendar;

import java.text.SimpleDateFormat;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

/**
 * @Description: 作用描述
 * @Author: hmm
 * @CreateDate: 2019/7/24$ 22:28$
 * @UpdateUser: hmm
 * @UpdateDate: 2019/7/24$ 22:28$
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
public class CalendarTest {


    public static void main(String[] args) {
        /*String weekBegin = DateUtil.getWeekBegin();
        System.out.println(weekBegin);
        String weekEnd = DateUtil.getWeekEnd();
        System.out.println(weekEnd);
        int weekOfYear = DateUtil.getWeekOfYear();
        System.out.println(weekOfYear);*/
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
        List<String> monthList = new ArrayList<>();
        for (int i = 0; i<=5; i++) {
            Calendar calendar = Calendar.getInstance();
            calendar.set(Calendar.MONTH,calendar.get(Calendar.MONTH)-i);
            String month = format.format(calendar.getTime());
            monthList.add(month);
        }
        System.out.println(monthList.toArray());
    }
}
